package luj.tool.jnproxyan.framework.lujnet;

import io.netty.handler.codec.socksx.v5.Socks5AuthMethod;
import luj.cluster.api.actor.Tellable;
import luj.net.api.client.ConnectionFactory;
import luj.net.api.client.NetConnection;
import luj.net.api.server.ConnectionAcceptInitializer;

import java.net.InetAddress;
import java.util.Set;

public class ConnState {

  public ConnState(Long reqId, Tellable socksRef, ConnectionAcceptInitializer.Connection c2pConnection) {
    _reqId = reqId;
    _socksRef = socksRef;
    _c2pConnection = c2pConnection;
  }

  public int getVer() {
    return _ver;
  }

  public void setVer(int ver) {
    _ver = ver;
  }

  public int getnMethods() {
    return _nMethods;
  }

  public void setnMethods(int nMethods) {
    _nMethods = nMethods;
  }

  public Set<Socks5AuthMethod> getMethods() {
    return _methods;
  }

  public void setMethods(Set<Socks5AuthMethod> methods) {
    _methods = methods;
  }

  public int getCmd() {
    return _cmd;
  }

  public void setCmd(int cmd) {
    _cmd = cmd;
  }

  public int getDomainLen() {
    return _domainLen;
  }

  public void setDomainLen(int domainLen) {
    _domainLen = domainLen;
  }

  public String getDstAddr() {
    return _dstAddr;
  }

  public void setDstAddr(String dstAddr) {
    _dstAddr = dstAddr;
  }

  public int getDstPort() {
    return _dstPort;
  }

  public void setDstPort(int dstPort) {
    _dstPort = dstPort;
  }

  public void setP2sConnection(NetConnection p2sConnection) {
    _p2sConnection = p2sConnection;
  }

  public Long getReqId() {
    return _reqId;
  }

  public Tellable getSocksRef() {
    return _socksRef;
  }

  public ConnectionAcceptInitializer.Connection getC2pConnection() {
    return _c2pConnection;
  }

  public NetConnection getP2sConnection() {
    return _p2sConnection;
  }

  private int _ver;
  private int _nMethods;
  private Set<Socks5AuthMethod> _methods;

  private int _cmd;
  private int _domainLen;
  private String _dstAddr;
  private int _dstPort;

  @Deprecated
  private NetConnection _p2sConnection;

  private final Long _reqId;
  private final Tellable _socksRef;
  private final ConnectionAcceptInitializer.Connection _c2pConnection;
}
